﻿using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Model
{    
    public class BaseModel
    {
        public int Id { get; set; }

        public DateTime? Created { get; set; }

        public int? CreatedByUserId { get; set; }

        public DateTime? Modified { get; set; }

        public int? ModifiedByUserId { get; set; }
        
        public virtual User CreatedByUser { get; set; }

        public virtual User ModifiedByUser { get; set; }

        [NotMapped]
        public string CreatedBy 
        {
            get
            {
                return CreatedByUser.FullName;
            }
        }
        [NotMapped]
        public string ModifiedBy 
        {
            get
            {
                return ModifiedByUser.FullName;
            }
        }
    }
}
